<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<s:url value="/images" var="imgPath"/>
<!-- 月历 -->
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick-zh-CN.js"></script>
<link rel="stylesheet" type="text/css" href="/css/smoothness.datepick.css" />
<script language="javascript">
	$().ready( function() {
		$('#paramStartDate').datepick({minDate: null, showOn: 'both', 
	    	buttonImageOnly: true, buttonImage: '${imgPath}/calendar.gif',numberOfMonths:2,dateFormat:"yy-mm-dd",yearRange: '-50:+50'});
		$('#paramEndDate').datepick({minDate: new Date(), showOn: 'both', 
		   	  buttonImageOnly: true, buttonImage: '${imgPath}/calendar.gif',numberOfMonths:2,beforeShow:customRange,dateFormat:"yy-mm-dd",yearRange: '-50:+50'});
		function customRange (){
			var startDt = $('#paramStartDate').val(); //起始日
			var endDt = new Date(parseInt(startDt.substring(0,4),10),parseInt(startDt.substring(5,7),10)-1,parseInt(startDt.substring(8,10),10)); //結束日
			return {minDate:endDt}; 
		}
	});	

</script>

<!--用 css 把輸入的優惠碼自動轉小寫-->
<style type="text/css"> 
	#couponItemCode {
		text-transform: lowercase; /* force text to lowercase */ 
	} 
</style>
<div style="color:red">
<s:actionerror/>
<s:actionmessage/>
<s:fielderror />
</div> 
<s:form action="queryCouponByCouponItemCode.do" method="post" id="formObj">
	<s:hidden name="currentPage" />
	<h1>Coupon Code 查詢</h1>
	<div class="f-link">
		<a href="#" onclick="document.formObj.submit();">搜寻</a>
	</div>
	<div class="data-form">
		<b>
			优惠码（Coupon Item Code）：
		</b>
		<!--用 css 把輸入的優惠碼自動轉小寫-->
		<s:textfield name="couponItemCode" id="couponItemCode" />
		<br/>
	</div>
</s:form>
